/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package astralmlprocessor;

import org.w3c.dom.*;

/**
 *
 * @author age
 */
public class XmlUtils {
    public static Node getItem(NodeList list, String attrName, String value) {
        Node result = null;
        for (int i=0; i<list.getLength() && result == null; i++) {
            Node attr = list.item(i).getAttributes().getNamedItem(attrName);
            if (attr != null && attr.getNodeValue().equals(value)) {
                result = list.item(i);
            }
        }
        return result;        
    }
}
